package com.ruoyi.advertising.mapper;

import java.util.List;
import com.ruoyi.advertising.domain.ExpressAdvertising;
import org.apache.ibatis.annotations.*;

/**
 * 公告Mapper接口
 * 
 * @author ruoyi
 * @date 2024-08-22
 */
public interface ExpressAdvertisingMapper 
{
    /**
     * 查询公告
     * 
     * @param id 公告主键
     * @return 公告
     */
    public ExpressAdvertising selectExpressAdvertisingById(Integer id);

    /**
     * 查询公告列表
     * 
     * @param expressAdvertising 公告
     * @return 公告集合
     */


    /**
     * 新增公告
     * 
     * @param expressAdvertising 公告
     * @return 结果
     */
    public int insertExpressAdvertising(ExpressAdvertising expressAdvertising);

    /**
     * 修改公告
     * 
     * @param expressAdvertising 公告
     * @return 结果
     */
    public int updateExpressAdvertising(ExpressAdvertising expressAdvertising);

    /**
     * 删除公告
     * 
     * @param id 公告主键
     * @return 结果
     */
    public int deleteExpressAdvertisingById(Integer id);


    @Select("select * from express_advertising")
    public List<ExpressAdvertising> selectExpressAdvertisingList(ExpressAdvertising expressAdvertising);


    @Insert("insert into express_advertising(client,announcement,language,advertisement,announcementcontent,detrusion,effluxtime,status,creation) values (#{jia.client},#{jia.announcement},#{jia.language},#{jia.advertisement},#{jia.announcementcontent},#{jia.detrusion},#{jia.effluxtime},#{jia.status},#{jia.creation})")
    void add(@Param("jia") ExpressAdvertising jia);
    @Update("update express_advertising set status=1 where id=#{id}")
    void shangjia(Integer id);
    @Update("update express_advertising set status=2 where id=#{id}")
    void xiajia(Integer id);
    @Update("update express_advertising set status=1,effluxtime=#{enen.effluxtime} where id=#{enen.id}")
    void congxin(@Param("enen") ExpressAdvertising enen);
    @Delete("delete from express_advertising where id=#{id}")
    void shan(Integer id);
    @Update("update express_advertising set status=3 where id=#{id}")
    void guoqi(Integer id);
}
